package cn.cy.behavior.strategy.general;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-09
 */
public class Payment {

    private String type;

    public Payment(String type) {
        this.type = type;
    }

    public void pay(double amount) {
        if ("CREDIT_CARD".equals(type)) {
            System.out.println("使用信用卡支付: " + amount);
        } else if ("ALIPAY".equals(type)) {
            System.out.println("使用支付宝支付: " + amount);
        } else if ("WECHAT_PAY".equals(type)) {
            System.out.println("使用微信支付: " + amount);
        } else {
            System.out.println("无效的支付方式");
        }
    }

}
